<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>基于Vue.js的冒泡排序模拟动画DEMO演示</title>

<link rel="stylesheet" href="css/style.css">

</head>
<body>

<div id="app">
	<div class="cards">
		<sort-card v-for="(card, index) in store.state.cards" :key="index" :value="card.value" :sort-index="card.sortIndex" :is-active="card.isActive" :is-locked="card.isLocked"></sort-card>
	</div>
	<div class="control-panel">
		<h1>Bubble Sort Visualizer</h1>
		<button aria-label="Reset" v-if="store.state.done" @click="reset(SORT_ARRAY)">
			<i class="fa fa-refresh" aria-hidden="true"></i>
		</button>
	</div>
</div>

<script type="text/x-template" id="sort-card-template">

	<!-- 绑定内联样式，通过 height 和 transform 来显示不同的div -->
	<div class="card-wrapper" :data-sort-index="sortIndex" v-bind:style="{height: value * HEIGHT_INCREMENT + 'px',transform: 'translateX('+sortIndex*100+'%)'}">
	<!-- 通过改变class，来改变颜色 -->
	<div class="card" :class="cardClassObject">
	<div class="value">{{value}}</div>
	</div>
	</div>
  
</script>

<script src='js/vue.min.js'></script>
<script src='js/vuex.min.js'></script>

<script src="js/index.js"></script>

<div style="text-align:center;clear:both;margin-top:40px;">
<script src="/gg_bd_ad_720x90.js" type="text/javascript"></script>
<script src="/follow.js" type="text/javascript"></script>
</div>

</body>
</html>